﻿ 

 

// ******************************************************
// 这段代码是自动生成的
// 修改里面的代码，下次生成的时候会被覆盖
// ******************************************************
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.ServiceModel;
using System.Threading.Tasks;
using Sharp.Application;
using Sharp.DataTransferObject;
using System.ServiceModel.Activation;
using Sharp.Infrastructure.Search;
using Sharp.DataTransferObject.WFDemo;
using Sharp.ServiceContracts;
using Sharp.Infrastructure;
using Sharp.Infrastructure.Interfaces;
using Sharp.Infrastructure.IoC;
namespace Sharp.Services
{
	//[DebuggerStepThrough]
	[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
	[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple, UseSynchronizationContext = false)]
	public class DemoService : ITroubleshootingSerivce
	{
		private readonly ITroubleshootingSerivce _impl = ServiceLocator.Instance.GetService<ITroubleshootingSerivce>();
		public Result SaveTroubleshooting(TroubleshootingDTO model)
		{
			try
			{
				return _impl.SaveTroubleshooting(model);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Result DeleteTroubleshooting(Int32[] ids)
		{
			try
			{
				return _impl.DeleteTroubleshooting(ids);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public TroubleshootingDTO GetTroubleshootingInfo(Int32 id)
		{
			try
			{
				return _impl.GetTroubleshootingInfo(id);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public IEnumerable<Sharp.DataTransferObject.WFDemo.TroubleshootingDTO> GetDangers(DateTime eventTime)
		{
			try
			{
				return _impl.GetDangers(eventTime);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public PagedResult<Sharp.DataTransferObject.WFDemo.TroubleshootingDTO> GetTroubleshootingPaged(PagingFeature pf)
		{
			try
			{
				return _impl.GetTroubleshootingPaged(pf);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Result SaveConfirmation(ConfirmationDTO dto)
		{
			try
			{
				return _impl.SaveConfirmation(dto);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Result SaveAcceptance(AcceptanceDTO dto)
		{
			try
			{
				return _impl.SaveAcceptance(dto);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Result SaveRectification(RectificationDTO dto)
		{
			try
			{
				return _impl.SaveRectification(dto);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
		public Result SaveWriteOff(WriteOffDTO dto)
		{
			try
			{
				return _impl.SaveWriteOff(dto);
			}
			catch(Exception ex)
			{
				throw new FaultException<FaultData>(FaultData.CreateFromException(ex), FaultData.CreateFaultReason(ex));
			}
		}
	}
}